﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using PageTemplateLib;
using XCMSData;
using System.Collections.Generic;

public partial class Index : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        PageTemplate pt = new PageTemplate();
        PageTemplate.SkinPath = @"templates";

        IList<XCMSData.Board> bs = XCMSData.Board.SelectAllForIndex();
        IList<XCMSData.Title> title = XCMSData.Title.SelectAll();
        pt.AddData("X_Board", bs);
        foreach (XCMSData.Board b in bs)
        {
            pt.AddData(b.BoardName, XCMSData.Title.SelectAll(XCMSData.Title._.BoardID, b.ID, 0, 10));
        }
        //pt.AddData("新生命讲座", title);
        //pt.AddData("ASP学习", title);
        //pt.AddData("Net编程", title);
        //pt.AddData("我的垃圾工具", title);
        //pt.AddData("我的宝贝", title);
        //pt.AddData("系统编程", title);
        //pt.AddData("编译原理", title);
        //pt.AddData("其它文章", title);

        pt.AddData("公告栏", XCMSData.Title.SelectAllForBoard("公告", 10));
        pt.AddData("最新热点文章", XCMSData.Title.SelectTop(20));

        Response.Write(pt.GetTemplate("default", "_index"));
    }
}
